<!DOCTYPE html>
<style>
.x { position: absolute; color: red; }
.y { color: green; }
</style>
<div class=x>hello</div>
<script>
document.body.offsetHeight;
document.querySelector(".x").className = "y";
document.body.offsetHeight;
</script>
